<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增api')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-param-add">
        	<input type="hidden" name="apiId" th:value="${apiId}">
			<div class="form-group">	
				<label class="col-sm-3 control-label"><span style="color: red; ">*</span>参数名称：</label>
				<div class="col-sm-8">
					<input id="paramName" name="paramName" class="form-control" type="text" required>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label"><span style="color: red; ">*</span>必填：</label>
				<div class="col-sm-8">
					<select id="paramRequired" name="paramRequired" class="form-control" required>
						<option value="false">否</option>
						<option value="true">是</option>
					</select>
				</div>
			</div>
<!-- 			string/date/number/boolean/jsonArray/jsonObject/file -->
			<div class="form-group">	
				<label class="col-sm-3 control-label"><span style="color: red; ">*</span>数据类型：</label>
				<div class="col-sm-8">
					<select id="paramType" name="paramType" class="form-control" required>
						<option value="string">字符串</option>
						<option value="number">数字</option>
						<option value="date">日期</option>
						<option value="boolean">布尔值</option>
						<option value="json">json格式</option>
						<option value="file">文件格式(图片/音视频等)</option>
						<option value="other">其他</option>
					</select>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">自定义正则校验规则：</label>
				<div class="col-sm-8">
					<input id="paramCheckRegex" name="paramCheckRegex" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<textarea id="remark" name="remark" class="form-control"></textarea>
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    
    <script type="text/javascript">
		var prefix = ctx + "api/apiUrlParam"
		$("#form-param-add").validate({
			focusCleanup: true
		});
		
		function submitHandler() {
			if ($.validate.form()) {
				$.operate.save(prefix + "/add", $('#form-param-add').serialize());
	        }
	    }
	</script>
</body>
</html>
